<!--
*Author： 采购供应

 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/proSupply/retailDock.js此处编写
 -->
 <template>
  <div>
    <view-grid
      ref="grid"
      :columns="columns"
      :editFormFields="editFormFields"
      :editFormFileds="editFormFields"
      :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields"
      :searchFormFileds="searchFormFields"
      :searchFormOptions="searchFormOptions"
      :table="table"
      :extend="extend"
    >
    </view-grid>
  </div>
</template>
<script>
import extend from "@/extension/proSupply/retailDock.js";
import ViewGrid from "@/components/basic/ViewGrid.vue";
var vueParam = {
  components: {
    ViewGrid,
  },
  data() {
    return {
      table: {
        key: "id",
        footer: "Foots",
        cnName: "采购供应",
        name: "SupplierNews",
        url: "/SupplierNews/",
        sortName: "createDate",
      },
      extend: extend,
      editFormFields: {
        supplierCode: "",
        supplierName: "",
        supplierName1: "",
        supplierType: "",
        appKey: "",
        appSecret: "",
        supplierUrl: "",
        creator: "",
        createID: "",
        createDate: "",
        modifier: "",
        modifyDate: "",
        isAvailable: "1",
      },
      editFormOptions: [
        [
          {
            title: "供应商编码",
            required: true,
            field: "supplierCode",
            type: "text",
          },
        ],
        [
          {
            title: "供应商名称",
            required: true,
            field: "supplierName",
            type: "text",
          },
          { title: "供应商简称", field: "supplierName1", type: "text" },
        ],
        [
          {
            dataKey: "SupplierType1",
            data: [],
            title: "供应商类别",
            required: true,
            field: "supplierType",
            type: "select",
          },
          { title: "接口地址", field: "supplierUrl", type: "text" },
        ],
        [
          { title: "分销商ID", field: "appKey", type: "text" },
          {
            title: "AppSecret",
            field: "appSecret",
            type: "text",
            hidden: false,
          },
        ],
        [
          {
            dataKey: "enable",
            data: [],
            title: "是否可用",
            required: true,
            field: "isAvailable",
            type: "switch",
          },
        ]
      ],
      searchFormFields: {
        supplierCode: "",
        supplierName: "",
        supplierPhone: "",
        supplierSystem: 1,
      },
      searchFormOptions: [
        [
          { title: "供应商名称", field: "supplierName", type: "like" },
          { title: "供应商编码", field: "supplierCode", type: "like" },
          { title: "供应商简称", field: "supplierName1", type: "like" },
          { title: "", field: "supplierSystem", hidden: true },
        ],
      ],
      columns: [
        {
          field: "supplierCode",
          title: "供应商编码",
          type: "string",
          width: 200,
          require: true,
          align: "left",
          sortable: true,
        },
        {
          field: "supplierName",
          title: "供应商名称",
          type: "string",
          width: 200,
          require: true,
          align: "left",
        },
        {
          field: "supplierName1",
          title: "供应商简称",
          type: "string",
          width: 200,
          align: "left",
        },
        {
          field: "supplierType",
          title: "供应商类别",
          type: "string",
          bind: { key: "SupplierType1", data: [] },
          width: 120,
          require: true,
          align: "left",
        },
        {
          field: "appKey",
          title: "分销商ID",
          type: "string",
          width: 220,
          align: "left",
        },
        {
          field: "appSecret",
          title: "AppSecret",
          type: "string",
          width: 220,
          align: "left",
        },
        {
          field: "supplierUrl",
          title: "接口地址",
          type: "string",
          width: 250,
          align: "left",
        },
        {
          field: "isAvailable",
          title: "是否可用",
          type: "sbyte",
          bind: { key: "enable", data: [] },
          width: 80,
          require: true,
          align: "left",
        },
        {
          field: "creator",
          title: "创建人",
          type: "string",
          width: 120,
          readonly: true,
          align: "left",
        },
        {
          field: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 220,
          readonly: true,
          align: "left",
          sortable: true,
        },
        {
          field: "modifier",
          title: "修改人",
          type: "string",
          width: 120,
          readonly: true,
          align: "left",
        },
        {
          field: "modifyDate",
          title: "修改时间",
          type: "datetime",
          width: 220,
          readonly: true,
          align: "left",
          sortable: true,
        },
        {
          field: "createID",
          title: "创建人ID",
          type: "int",
          width: 120,
          hidden: true,
          align: "left",
        },
        {
          field: "id",
          title: "主键",
          type: "string",
          width: 120,
          hidden: true,
          readonly: true,
          require: true,
          align: "left",
        },
      ],
      detail: {
        cnName: "#detailCnName",
        columns: [],
        sortName: "",
        key: "",
      },
    };
  },
};
export default vueParam;
</script>
